// pages/gongxiu/beizhuname/index.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var beizhuopenid = options.beizhuopenid;
    var yuanname = options.beizhunickname;
    var headimgurl = options.beizhuurl;
   // console.log(yuanname + beizhuopenid)
    this.setData({
      beizhuopenid: beizhuopenid,
      yuanname: yuanname,
      headimgurl: headimgurl,
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
  formSubmit: function (e) {
    var rename = e.detail.value.rename;
    var beizhuopenid = this.data.beizhuopenid;
    var openid = app.openid;
      console.log('这里' + beizhuopenid + rename + openid)
    wx.request({
      url: 'https://api.bjlya.com.cn/nfq.php/index/Search/index2', // 仅为示例，并非真实的接口地址
      data: {
        rename: rename,
        beizhuopenid: beizhuopenid,
        openid: openid,
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        // console.log(res.data)
        wx.navigateBack({
          delta: 1
        })
      }
    })
   
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }

})